macos: do not crash in mojave
authorIgnacio Casal Quinteiro <qignacio@amazon.com>
Thu, 31 Dec 2020 10:35:04 +0000 (11:35 +0100)
committerIgnacio Casal Quinteiro <qignacio@amazon.com>
Thu, 31 Dec 2020 10:35:04 +0000 (11:35 +0100)
The localizedName property is not available in Mojave
so just ifdef in that case the code out.

gdk/macos/gdkmacosmonitor.c

index fdeadadcea1204dc05367b1a74e1b8a30613704e..ad124a9e6418a670d2c1935796c8e5cd08c6c9f2 100644 (file)
@@ -145,6 +145,7 @@ GetSubpixelLayout (CGDirectDisplayID screen_id)
 static char *
 GetLocalizedName (NSScreen *screen)
 {
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
   GDK_BEGIN_MACOS_ALLOC_POOL;
 
   NSString *str;
@@ -158,6 +159,9 @@ GetLocalizedName (NSScreen *screen)
   GDK_END_MACOS_ALLOC_POOL;
 
   return g_steal_pointer (&name);
+#else
+  return NULL;
+#endif
 }
 
 static char *